package dev.grafosPert;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainGrafosPert extends Activity {
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		final Button Bnuevo = (Button) findViewById(R.id.bnuevo);
		final Button Bcargar = (Button) findViewById(R.id.bcargar);
		final Button Bcreditos = (Button) findViewById(R.id.bcreditos);

		Bnuevo.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				Intent intent = new Intent(MainGrafosPert.this, Nuevo.class);
				startActivity(intent);
	        }
	    });

		Bcargar.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				Intent intent = new Intent(MainGrafosPert.this, Nuevo.class);
				startActivity(intent);
	        }
	    });
		
		Bcreditos.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				Intent intent = new Intent(MainGrafosPert.this, Nuevo.class);
				startActivity(intent);
	        }
	    });
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		MenuInflater inflater = getMenuInflater();
		inflater.inflate(R.menu.menu, menu);
		return true;
	}
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
			case R.id.menucreditos:
				startActivity(new Intent(this, About.class));
				return true;
            default:
                return super.onOptionsItemSelected(item);
        }
    }
}